/**
 *  配置导航栏
 */

const state = {
  environment: '',
  userInfo: {
    // SH_TEMP 商户临时用户  SH_HUIYUAN  商户会员用户  PT_FORMAL 平台用户
    // userId: 4,
    // mobile: '17694803106',
    // token:
    //   'eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0Iiwic3ViIjoiU0hfSFVJWVVBTl9fXzE3Njk0ODAzMTA2IiwiaWF0IjoxNjE5NTA5NjU0LCJleHAiOjE2MTk1Mzg0NTR9.venL1QJ4pid9qM9szoBGqvNUXyGZ8BQ8YRj0YU7u-gg',
    // userType: 'SH_HUIYUAN'
  },
  temporary: ''
}

const mutations = {
  SET_ENV: (state, env) => {
    state.environment = env
  },
  SET_USER_INFO: (state, obj) => {
    state.userInfo = obj
  },
  SET_TEM: (state, obj) => {
    state.temporary = obj
  }
}

const actions = {
  setENV({ commit }, env) {
    commit('SET_ENV', env)
  },
  setUserInfo({ commit }, obj) {
    commit('SET_USER_INFO', obj)
  },
  setTem({ commit }, obj) {
    commit('SET_TEM', obj)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
